/* Checks numbers for repeated digits */
/* if in C89
#define true 1
#define false 0
typedef int bool;
*/
#include <stdbool.h>  /* C99 only */
#include <stdio.h>
int main(void)
{
    int digit;
    long n;
    for (;;) {
        printf("Enter a number (0 for exit): ");
        scanf("%ld", &n);
        if (n <= 0)
            break;
        bool digit_seen[10] = {false};
        while (n > 0) {
            digit = n % 10;
            if (digit_seen[digit])
                break;
            digit_seen[digit] = true;
            n /= 10;
        }
        if (n > 0)
            printf("Repeated digit\n");
        else
            printf("No repeated digit\n");
    }
    return 0;
}